﻿using System.Collections.Generic;
using Fetches.Fetch.Dto;

namespace Fetches.Fetch.Fetcher.LinkExtractor
{
    /// <summary>
    /// 页面链接抽取器，默认使用PatternMatchExtractor，Pattern默认包含在Order
    /// 为了弹性部署，尽量不要定制Extractor
    /// </summary>
    public interface ILinkExtractor
    {
        /// <summary>
        /// 从配置字符串中初始化
        /// </summary>
        /// <param name="config"></param>
        void Initialize(string config);

        /// <summary>
        /// 序列化配置,用于FetchOrder传递
        /// </summary>
        /// <returns></returns>
        string GetInitializeRule();

        IList<Request> ExtractLinks(ResponsePage responsePage);
    }
}
